package com.example.mytayunapi.Service;

import com.example.mytayunapi.Entity.commentInfo;
import com.example.mytayunapi.Mapper.commentInfoMapper;
import com.example.mytayunapi.Vo.ShareUserInfo;
import com.example.mytayunapi.Vo.UserCommentOrder;
import com.example.mytayunapi.Vo.UserOrderCommentOrder;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class commentInfoServiceImpl implements commentInfoService {
    @Autowired
    private commentInfoMapper commentinfoMapper;

    @Override
    public List<UserCommentOrder> getOrderUserComment(){
        return commentinfoMapper.getOrderUserComment();
    }

    @Override
    public List<UserCommentOrder> getCommentUserOrderId(Integer Comment_id){
        return commentinfoMapper.getCommentUserOrderId(Comment_id);
    }

    @Override
    public Integer updateCommentInfoByOrderId(UserCommentOrder commentStatusInfo){
        return commentinfoMapper.updateCommentInfoByOrderId(commentStatusInfo);
    }


    //分页
    @Override
    public PageInfo<UserCommentOrder> getPageInfo(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<UserCommentOrder> UserCommentOrder = commentinfoMapper.getOrderUserComment();
        PageInfo<UserCommentOrder> pageInfo = new PageInfo<>(UserCommentOrder);
        return pageInfo;
    }

    @Override
    public List<UserCommentOrder> getCommentUserOrderStatus(String Comment_status) {
        return commentinfoMapper.getCommentUserOrderStatus(Comment_status);
    }

    @Override
    public List<UserCommentOrder> getCommentUserOrderStatusNa(String Comment_status) {
        return commentinfoMapper.getCommentUserOrderStatusNa(Comment_status);
    }
//
    @Override
    public List<UserCommentOrder> getCommentcontentArank(String keyword, String Comment_rank) {
        return commentinfoMapper.getCommentcontentArank(keyword,Comment_rank);
    }

    @Override
    public List<UserCommentOrder> getCommentcontentArankNA(String keyword, String Comment_status) {
        return commentinfoMapper.getCommentcontentArankNA(keyword,Comment_status);
    }

    @Override
    public List<UserCommentOrder> getCommentcontent(String keyword) {
        return commentinfoMapper.getCommentcontent(keyword);
    }

    @Override
    public List<UserCommentOrder> getCommentrank(String Comment_rank) {
        return commentinfoMapper.getCommentrank(Comment_rank);
    }

    @Override
    public List<UserOrderCommentOrder> getMaijiaPingjia(String School_degree) {
        return commentinfoMapper.getMaijiaPingjia(School_degree);
    }

    @Override
    public Integer insertCommentInfoByOrderId(commentInfo commentinfo) {
        return commentinfoMapper.insertCommentInfoByOrderId(commentinfo);
    }


}
